package com.itheima.mapper;

import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.CheckItem;

import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CheckitemMapper {
    //新增检查项
    @Insert("insert into t_checkitem(code, name, sex, age, price, type, attention, remark)" +
            " values(#{code},#{name},#{sex},#{age},#{price},#{type},#{attention},#{remark})")
    void add(CheckItem checkItem);

    //删除检查项
    @Delete("delete from t_checkitem where id = #{id}")
    void delete(Integer id);

    // 条件分页查找检查项
    List<CheckItem> findPage(QueryPageBean queryPage);

    //查询所有检查项
    @Select("select * from t_checkitem")
    List<CheckItem> findAll();
    //根据id查询检查项
    @Select("select * from t_checkitem where id = #{id}")
    CheckItem findById(Integer id);


    void edit(CheckItem checkItem);
}
